1. Field of the Invention
The present invention generally relates to geometric processing in graphics systems and more specifically to a system and method for symmetric parameterization of independently tessellated patches.
2. Description of the Related Art
Modern three-dimensional (3D) graphics systems are typically configured to generate one or more graphics images from one or more graphics scenes, with each graphics scene comprising one or more geometric models. The one or more graphics images are then displayed or stored for display later. Each geometric model may include geometric objects such as triangles, meshes, parametric patches, or other types of constructs useful in rendering a graphics scene. In many applications the meshes should not have any cracks or holes, and should not include any overlapping geometry. Certain types of high-level geometric objects, such as parametric patches, may be conveniently represented and manipulated using a relatively small set of high-level attributes. To render a high-level geometric object using a conventional graphics hardware pipeline, the high-level geometric object is tessellated into triangles, which are then rendered by the graphics hardware pipeline. Certain graphics hardware pipeline architectures provide programmable geometry processing functionality, including tessellation.
A parametric quad patch is one class of useful geometric object. A given parametric quad patch may be usefully represented and evaluated using a barycentric parameterization, which defines each quad patch parameter in a range from zero to one. Each parametric quad patch is typically defined by four boundaries (edges), and each boundary is parameterized using a pair of parameters that maintain a property of having a sum equal to one (1.0). Each parameter is typically represented using a floating-point value. Along a given boundary, a primary parameter from the pair of parameters ranges from zero to one, while a second parameter ranges from one to zero, maintaining a sum of the two parameters that is equal to one.
A geometric model may include two or more parametric quad patches that form a mesh that defines at least part of the geometric model. Each of the two or more parametric quad patches typically shares at least one abutting boundary with an adjacent parametric quad patch. When the geometric model is rendered, each given parametric quad patch is tessellated into a corresponding se of triangles for shading. Each parametric quad patch may be tessellated independently of any neighboring quad patches. During tessellation, each boundary for a given parametric quad patch is split into a predetermined number of segments that define corresponding triangle vertices along the boundary. For example, a boundary may be split into three equal portions to create vertices for associated triangles. Each split is performed with respect to an associated parametric quad patch during tessellation of the quad patch. As a result, each shared boundary is split independently for each parametric quad patch.
Persons skilled in the art will understand that, in general, adjacent parametric quad patches cannot be consistently parameterized with respect to a given arbitrary shared boundary in an arbitrary mesh of quad patches. As a consequence, two adjacent parametric quad patches may share two common vertices (V1 and V2) that define a common boundary that is parameterized in opposite directions with respect to the common vertices. More specifically, one parametric quad patch may be parameterized with barycentric parameter pair (0.0, 1.0) at V1 and (1.0, 0.0) at V2, while the adjacent parametric quad patch may be parameterized with barycentric parameter pair (1.0, 0.0) at V1 and (0.0, 1.0) at V2.
In a scenario where the common boundary is split into three portions, one parametric quad patch may include a particular vertex at a position that is logically “⅓” (⅓, ⅔) along the boundary while the other parametric quad patch may include a matching vertex that is logically in the same location, which corresponds to “⅔” (⅔, ⅓) along the boundary running in an opposite direction. Because each position is represented using a floating-point approximation of a fraction, round-off error will commonly perturb the location represented by each of the two vertices differently. In some cases, the round-off error can sufficiently perturb one of the vertices away from the other to cause a crack or a hole in the mesh, leading to diminished image quality in the graphics images generated by the 3D graphics system.
Accordingly, what is needed in the art is a system and method for tessellating parametric quad patches within a mesh without introducing holes in the mesh.